<div class="query-wrapper">
  <form class="form-inline" #myQuery="ngForm">
    <div class="form-group">
      <label>数据类型：</label>
      <select class="form-control" style="border-radius: 4px;" [(ngModel)]="params.item.datatype" name="datatype" (change)="clear()">
          <option *ngFor="let select of selects" [value]="select.value">
              {{select.name}}
          </option>
      </select> 
    </div>
    <app-time-picker (emitTime)= "getTime($event)" ></app-time-picker>
    <div class="form-group">
      <label>费率：</label>
      <input type="number" placeholder="0.0000" class="form-control" step="0.0001" max="1" min="0"
      [(ngModel)]="params.item.charge" name='charge' required>
    </div>  
    <div class="form-group">
      <button class="btn btn-primary btn-sm" [disabled]="!myQuery.form.valid"  (click)="add()"><i class="fa fa-plus-circle" aria-hidden="true"></i>&nbsp;&nbsp;新增</button>
    </div>
  </form>
</div>
<div class="container table-striped-wrapper">
    <div class="row">
      <div class="col-sm-1"></div>
      <div class="col-sm-10">
        <table class="table table-striped">
          <thead> 
            <tr>
              <th *ngFor="let th of ths">{{th}}</th>
            </tr>
          </thead>
          <tbody>
            <tr *ngFor="let tr of trs"> 
              <td>{{tr.datatype | dataType}}</td>
              <td>{{tr.begintime}}</td>
              <td>{{tr.endtime}}</td>
              <td>{{tr.charge}}</td>
              <td>
                <button type="button" class="btn btn-warning btn-xs" (click)= 'update(tr.id)'>修改</button>
                &nbsp;&nbsp;
                <button type="button" class="btn btn-danger btn-xs"  (click)= 'del(tr.id)'>删除</button>
              </td>
            </tr>
            <tr > 
              <td></td>
              <td></td>
              <td></td>
              <td></td>
<!--               <td>
                <button type="button" class="btn btn-warning btn-xs" (click)= 'update(22)'>修改</button>
                &nbsp;&nbsp;
                <button type="button" class="btn btn-danger btn-xs"  (click)= 'del(tr.id)'>删除</button>
              </td> -->
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
